<?php
header("Access-Control-Allow-Origin:*"); // 制定允许其他域名访问

header('Access-Control-Allow-Methods:POST'); // 响应类型

header('Access-Control-Allow-Headers:x-requested-with, content-type'); // 响应头设置
    include './base.php';
    $sql = "select * from room inner join roomtype where room.roomType = roomtype.rtId";
    $res = mysql_query($sql);
    $arr = array();
    while($row = mysql_fetch_assoc($res)){
        array_push($arr,$row);
    }
    print_r(json_encode($arr));
?>